package com.pushworld.grc.ui.innercheck;

import cn.com.infostrategy.ui.common.ClientEnvironment;
import cn.com.infostrategy.ui.common.WLTButton;
import cn.com.infostrategy.ui.mdata.BillListPanel;
import cn.com.infostrategy.ui.mdata.BillListSelectListener;
import cn.com.infostrategy.ui.mdata.BillListSelectionEvent;
import cn.com.infostrategy.ui.mdata.styletemplet.t0A.AbstractStyleWorkPanel_0A;
import cn.com.infostrategy.ui.mdata.styletemplet.t0A.IUIIntercept_0A;

public class IC_Checkbegin implements IUIIntercept_0A, BillListSelectListener {

	private BillListPanel list;
	private WLTButton delte, edit;
	private String login_id = "";
	private boolean b = false;

	public void afterSysInitialize(AbstractStyleWorkPanel_0A _panel) throws Exception {
		list = _panel.getBillListPanel();
		list.addBillListSelectListener(this);
		delte = list.getBillListBtn("comm_listedit");
		edit = list.getBillListBtn("comm_listdelete");
		login_id = ClientEnvironment.getCurrSessionVO().getLoginUserId();
	}

	public void onBillListSelectChanged(BillListSelectionEvent _event) {
		if (login_id.equals(list.getSelectedBillVO().getStringValue("BEGINPEOP"))) {

			b = true;
		} else {
			b = false;
		}

		delte.setEnabled(b);
		edit.setEnabled(b);
	}

}
